const db = require("../../lib/db");

//新建分组
exports.addSubset = (value) => {
    let _sql = `INSERT INTO subset set ?`;
    return db.queryWithPool(_sql, value);
  }
  
  //获取分组
  exports.getSubset = (classify) => {
    let _sql = `SELECT * FROM subset where classify = ?`;
    return db.queryWithPool(_sql, [classify]);
  };
  
  //修改分组名称
  exports.updateSubset = (id, name) => {
    let _sql = `UPDATE subset SET subset_name = ? WHERE id = ?`;
    return db.queryWithPool(_sql, [name, id]);
  };
  
  //删除分组
  exports.deleteSubset = (id) => {
    let _sql = `DELETE FROM subset WHERE id = ?`;
    return db.queryWithPool(_sql, [id]);
  };
